<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件和计算属性</title>
    <script src="../vue.global.js"></script>
    <style>
        .red{
            color:red;
        }
    </style>
</head>
<body>

<div id="App">
    <p>{{counter}}</p>
    <button v-on:click="counter++">counter++</button>
    <br/>
    <button v-on:click="addNum">counter++</button>
    <br/>
    {{fullName()}}
    <br/>
    {{fullnames}}
</div>


<script>



    const App = {

        data(){
            return {
                counter:10,
                province:"beijing",
                city:"天安门"
            }
        },
        methods:{
            addNum(){
                this.counter+=3;
            },
            fullName(){
                return this.province+this.city;
            }
        },
        computed:{
            fullnames(){
                return this.province+"==="+this.city;
            }
        }
    };

    const vm = Vue.createApp(App).mount("#App")


</script>
</body>
</html>